package com.ciaojian.worker.model.query;

import com.ciaojian.core.model.Scheduling;
import com.ciaojian.core.model.group.Save;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.Valid;
import javax.validation.constraints.Future;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;

/**
 * 提交排班参数
 *
 * @author Atlakyn
 */
@Data
public class SchedulingApplyQuery {
    @Valid
    private List<Scheduling> schedulingList;

    @ApiModelProperty("门店Id")
    @NotNull(message = "门店Id不能为空", groups = Save.class)
    private Integer storeId;

    @ApiModelProperty("门店名称")
    @NotBlank(message = "门店名称不能为空", groups = Save.class)
    private String storeName;

    @ApiModelProperty("发型师Id")
    @NotNull(message = "提交发型师Id不能为空", groups = Save.class)
    private Integer workerId;

    @ApiModelProperty("起始日期")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Future(message = "起始日期有误", groups = Save.class)
    @NotNull(message = "起始日期不能为空", groups = Save.class)
    private Date beginDate;

    @ApiModelProperty("结束日期")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Future(message = "结束日期有误", groups = Save.class)
    @NotNull(message = "结束日期不能为空", groups = Save.class)
    private Date endDate;
}